package com.ssm.dao;

import com.ssm.pojo.Books;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Cat.Sir
 * Description:
 * DateTime: 2022-04-28 22:41
 */

public interface BookMapper {

    //增加一个Book
    int addBook(Books books);

    //根据id删除一个Book
    int deleteBookById(@Param("bookId") int id);

    //更新Book
    int updateBook(Books books);

    //根据id查询,返回一个Book
    Books queryBookById(@Param("bookId") int id);

    //查询全部Book,返回list集合
    List<Books> queryAllBook();

    //通过书名查找书本
    Books queryBookByName(@Param("bookName") String bookName);

    //分页查询
    List<Books> queryBookByPage(@Param("start") int start,@Param("end") int end);

    //通过id查询书名
    String queryBookNameById(@Param("id") int id);

}
